OpenMP versus threading in C/C++

نویسندگان

  • Bob Kuhn
  • Paul Petersen
  • Eamonn O'Toole
چکیده

When comparing OpenMP to other parallel programming models, it is easier to choose between OpenMP and MPI than between OpenMP and POSIX Threads (Pthreads). With languages like C and C++, developers frequently have chosen Pthreads to incorporate parallelism in applications. Few developers are currently using OpenMP C/C++, but they should. We show that converting Genehunter, a hand threaded C program, to OpenMP increases robustness without sacrificing performance. It is also a good case study as it highlights several issues that are important in understanding how OpenMP uses threads. Genehunter is a genetics program which analyzes DNA assays from members of a family tree where a disease is present in certain members and not in others. This analysis is done in an attempt to identify the gene most likely to cause the disease. This problem is called linkage analysis. The same sections of Genehunter were parallelized first by hand threading and then with OpenMP on Compaq Alpha Tru64 systems. We present examples using both methods and illustrate the tools that proved useful in the process. Our basic conclusion is that although we could express the parallelism using either Pthreads or OpenMP, it was easier to express the parallelism at a higher level of abstraction. OpenMP allowed enough control to express the parallelism without exposing the implementation details. Also, due to the higher level specification of parallelism with OpenMP, the tools available to assist in the construction of correct and efficient programs provide more useful information than the equivalent tools available for hand threaded programs. The following concepts are presented: • Differences between coding styles for OpenMP and Pthreads. • Data scoping specification for correct parallel programming. • Adapting a signal based exception mechanism to a parallel program. • OpenMP tools: Debuggers – Ladebug, TotalView and Assure, Profilers – Hiprof and GuideView. • Performance tuning with memory allocation, synchronization, and scheduling. Genehunter does not cover a few important topics in C/C++ programming style that will be discussed separately. These are: • Interfacing a GUI team of threads with an OpenMP compute team. • Coordinating data structure with scheduling.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Exploring the Use of Hyper-Threading Technology for Multimedia Applications with Intel® OpenMP* Compiler

Processors with Hyper-Threading technology can improve the performance of applications by permitting a single processor to process data as if it were two processors by executing instructions from different threads in parallel rather than serially. However, the potential performance improvement can be only obtained if an application is multithreaded by parallelization techniques. This paper pres...

متن کامل

Implementing Parallel Algorithms of MapReduce

In this paper we present the implementing of parallel algorithms of MapReduce problem in C++, C# and F# languages with technologies OpenMP, MPI, TPL, PPL, Threading. Firstly we describe the algorithm and introduce the basics of its parallelization. At the last section we show the execution results of parallelized programs.

متن کامل

Intel OpenMP C++/Fortran Compiler for Hyper-Threading Technology: Implementation and Performance

In the never-ending quest for higher performance, CPUs become faster and faster. Processor resources, however, are generally underutilized by many applications. Intel’s Hyper-Threading Technology is developed to resolve this issue. This new technology allows a single processor to manage data as if it were two processors by executing data instructions from different threads in parallel rather th...

متن کامل

OpenMP Performance Analysis Approach in the INTONE Project

In this paper we present the general approach adopted in the INTONE project for performance analysis and optimization of OpenMP applications. The approach considers the following components: runtime interface (instrumentation and threading support) and its library implementation, compilation environments for Fortran90 and C/C++, and an extension of the VAMPIR graphical tool. The paper also incl...

متن کامل

OCCA: A unified approach to multi-threading languages

The inability to predict lasting languages and architectures led us to develop occa, a C++ library focused on host-device interaction. Using run-time compilation and macro expansions, the result is a novel single kernel language that expands to multiple threading languages. Currently, occa supports device kernel expansions for the OpenMP, OpenCL, and CUDA platforms. Computational results using ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Concurrency - Practice and Experience

دوره 12  شماره 

صفحات  -

تاریخ انتشار 2000